package com.songyl.mapper;

import com.songyl.entity.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.io.Serializable;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author SYL
 * @since 2022-03-20
 */
public interface BookMapper extends JpaRepository<Book,Integer>, Serializable {

    /**
     * 通过ISBN查找书籍
     * @param ISBN
     * @return
     */
    @Query(value = "select b from Book b where b.isbn=?1")
    Book findBookByISBN (String ISBN);

}
